package com.matrix.java.chap_05.example;

import java.util.Scanner;

public class Case5_05 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int sum = 0;
        int data;
        System.out.print("输入（0结束）：");
        data = input.nextInt();
        while (data != 0) {
            sum += data;
            System.out.print("输入（0结束）：");
            data = input.nextInt();
        }
        System.out.println(sum);
        input.close();
    }
}
